package com.wolf.gulimall.auth.vo;


import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 用户注册实体类
 */
@Data
public class UserRegisteredVo {

    /**
     * 用户名
     */
    @NotNull(message = "用户名不能为空")
    @Length(min = 6,max = 18,message = "用户名长度必须为6-18位之间")
    private String userName;

    /**
     * 密码
     */
    @NotNull(message = "密码不能为空")
    @Length(min = 6,max = 18,message = "密码长度必须为6-18位之间")
    private String passWord;

    /**
     * 手机号
     */
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确")
    private String phone;

    /**
     * 验证码
     */
    @NotNull(message = "验证码不能为空")
    private String code;


}
